<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>usbpsu: xusb_ch9_composite.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">usbpsu
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xusb__ch9__composite_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xusb_ch9_composite.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains the implementation of the composite device specific chapter 9 code for the example. </p>
<pre>
  MODIFICATION HISTORY:</pre><pre>  Ver   Who  Date     Changes
</p>
<hr/>
<p>
  1.0   rb   05/03/18 First release
  1.5   vak  03/25/19 Fixed incorrect data_alignment pragma directive for IAR</pre><pre>*</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a8eaa9363a2026b377cee0a09377f6420"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__ch9__composite_8c.html#a8eaa9363a2026b377cee0a09377f6420">Usb_Ch9SetupDevDescReply</a> (struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *InstancePtr, u8 *BufPtr, u32 BufLen)</td></tr>
<tr class="memdesc:a8eaa9363a2026b377cee0a09377f6420"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the device descriptor for the device.  <a href="#a8eaa9363a2026b377cee0a09377f6420">More...</a><br/></td></tr>
<tr class="separator:a8eaa9363a2026b377cee0a09377f6420"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f71c81f47255ca655c3fe4262b97b68"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__ch9__composite_8c.html#a5f71c81f47255ca655c3fe4262b97b68">Usb_Ch9SetupCfgDescReply</a> (struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *InstancePtr, u8 *BufPtr, u32 BufLen)</td></tr>
<tr class="memdesc:a5f71c81f47255ca655c3fe4262b97b68"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the configuration descriptor for the device.  <a href="#a5f71c81f47255ca655c3fe4262b97b68">More...</a><br/></td></tr>
<tr class="separator:a5f71c81f47255ca655c3fe4262b97b68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36f6da36a86aeccc3ffd45b8d20b72c2"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__ch9__composite_8c.html#a36f6da36a86aeccc3ffd45b8d20b72c2">Usb_Ch9SetupStrDescReply</a> (struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *InstancePtr, u8 *BufPtr, u32 BufLen, u8 Index)</td></tr>
<tr class="memdesc:a36f6da36a86aeccc3ffd45b8d20b72c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns a string descriptor for the given index.  <a href="#a36f6da36a86aeccc3ffd45b8d20b72c2">More...</a><br/></td></tr>
<tr class="separator:a36f6da36a86aeccc3ffd45b8d20b72c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b9c8f0b5b4de1072d44ca05f15d3601"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__ch9__composite_8c.html#a6b9c8f0b5b4de1072d44ca05f15d3601">Usb_Ch9SetupBosDescReply</a> (u8 *BufPtr, u32 BufLen)</td></tr>
<tr class="memdesc:a6b9c8f0b5b4de1072d44ca05f15d3601"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the BOS descriptor for the device.  <a href="#a6b9c8f0b5b4de1072d44ca05f15d3601">More...</a><br/></td></tr>
<tr class="separator:a6b9c8f0b5b4de1072d44ca05f15d3601"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af99800b04544fe0bfa385de154d79087"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__ch9__composite_8c.html#af99800b04544fe0bfa385de154d79087">Usb_SetConfiguration</a> (struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *InstancePtr, SetupPacket *<a class="el" href="xusbpsu_8h.html#afa0292a56da800bf5f863178ee72aeaf">Ctrl</a>)</td></tr>
<tr class="memdesc:af99800b04544fe0bfa385de154d79087"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes State of Core to USB configured State.  <a href="#af99800b04544fe0bfa385de154d79087">More...</a><br/></td></tr>
<tr class="separator:af99800b04544fe0bfa385de154d79087"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06c2b2b0fd41a23280a0fde1ef2950be"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__ch9__composite_8c.html#a06c2b2b0fd41a23280a0fde1ef2950be">Usb_SetConfigurationApp</a> (struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *InstancePtr, SetupPacket *SetupData)</td></tr>
<tr class="memdesc:a06c2b2b0fd41a23280a0fde1ef2950be"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called by Chapter9 handler when SET_CONFIGURATION command is received from Host.  <a href="#a06c2b2b0fd41a23280a0fde1ef2950be">More...</a><br/></td></tr>
<tr class="separator:a06c2b2b0fd41a23280a0fde1ef2950be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a043075687afdf64ad9382236bd155e60"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__ch9__composite_8c.html#a043075687afdf64ad9382236bd155e60">Usb_GetDescReply</a> (struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *InstancePtr, SetupPacket *SetupData, u8 *BufPtr)</td></tr>
<tr class="memdesc:a043075687afdf64ad9382236bd155e60"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns a keyboard descriptors.  <a href="#a043075687afdf64ad9382236bd155e60">More...</a><br/></td></tr>
<tr class="separator:a043075687afdf64ad9382236bd155e60"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6b9c8f0b5b4de1072d44ca05f15d3601"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Usb_Ch9SetupBosDescReply </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the BOS descriptor for the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BufPtr</td><td>is the pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

<p>References <a class="el" href="group__usbpsu__api.html#ga070b11a185cfb126e5ec5f3be63a77f0">__attribute__</a>.</p>

</div>
</div>
<a class="anchor" id="a5f71c81f47255ca655c3fe4262b97b68"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Usb_Ch9SetupCfgDescReply </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the configuration descriptor for the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance. </td></tr>
    <tr><td class="paramname">BufPtr</td><td>is the pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

<p>References <a class="el" href="xusb__wrapper_8c.html#a02e8ef492f6fb18133f23f90205cc573">IsSuperSpeed()</a>, <a class="el" href="struct_usb___dev_data.html#a35624c7f1dbe7a05bd61f4abf44d5cd8">Usb_DevData::PrivateData</a>, and <a class="el" href="xusbpsu_8h.html#a49b4750a0007cdf47d99b02c39d4ee3f">Status</a>.</p>

</div>
</div>
<a class="anchor" id="a8eaa9363a2026b377cee0a09377f6420"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Usb_Ch9SetupDevDescReply </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the device descriptor for the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance. </td></tr>
    <tr><td class="paramname">BufPtr</td><td>is pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

<p>References <a class="el" href="xusb__wrapper_8c.html#a02e8ef492f6fb18133f23f90205cc573">IsSuperSpeed()</a>, and <a class="el" href="xusbpsu_8h.html#a49b4750a0007cdf47d99b02c39d4ee3f">Status</a>.</p>

</div>
</div>
<a class="anchor" id="a36f6da36a86aeccc3ffd45b8d20b72c2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Usb_Ch9SetupStrDescReply </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns a string descriptor for the given index. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance. </td></tr>
    <tr><td class="paramname">BufPtr</td><td>is a pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer. </td></tr>
    <tr><td class="paramname">Index</td><td>is the index of the string for which the descriptor is requested.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

<p>References <a class="el" href="xusb__wrapper_8c.html#a02e8ef492f6fb18133f23f90205cc573">IsSuperSpeed()</a>, <a class="el" href="struct_usb___dev_data.html#a35624c7f1dbe7a05bd61f4abf44d5cd8">Usb_DevData::PrivateData</a>, and <a class="el" href="xusbpsu_8h.html#a49b4750a0007cdf47d99b02c39d4ee3f">Status</a>.</p>

</div>
</div>
<a class="anchor" id="a043075687afdf64ad9382236bd155e60"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Usb_GetDescReply </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SetupPacket *&#160;</td>
          <td class="paramname"><em>SetupData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns a keyboard descriptors. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance. </td></tr>
    <tr><td class="paramname">Ctrl</td><td>is a pointer to the Setup packet data. </td></tr>
    <tr><td class="paramname">BufPtr</td><td>is a pointer to the buffer that is to be filled with the descriptor.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

</div>
</div>
<a class="anchor" id="af99800b04544fe0bfa385de154d79087"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 Usb_SetConfiguration </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SetupPacket *&#160;</td>
          <td class="paramname"><em>Ctrl</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Changes State of Core to USB configured State. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance. </td></tr>
    <tr><td class="paramname">Ctrl</td><td>is a pointer to the Setup packet data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS else XST_FAILURE</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_usb___dev_data.html#a35624c7f1dbe7a05bd61f4abf44d5cd8">Usb_DevData::PrivateData</a>, <a class="el" href="xusb__wrapper_8c.html#a806fa9a72091f47fa04844f988166e70">SetConfigDone()</a>, and <a class="el" href="struct_usb___dev_data.html#ae6b25681fad0c3686de251a7e611f00f">Usb_DevData::State</a>.</p>

</div>
</div>
<a class="anchor" id="a06c2b2b0fd41a23280a0fde1ef2950be"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 Usb_SetConfigurationApp </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SetupPacket *&#160;</td>
          <td class="paramname"><em>SetupData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called by Chapter9 handler when SET_CONFIGURATION command is received from Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is pointer to <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance. </td></tr>
    <tr><td class="paramname">SetupData</td><td>is the setup packet received from Host.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS if successful,<ul>
<li>XST_FAILURE if unsuccessful. </li>
</ul>
</dd></dl>

<p>References <a class="el" href="struct_usb___dev_data.html#a35624c7f1dbe7a05bd61f4abf44d5cd8">Usb_DevData::PrivateData</a>, <a class="el" href="xusb__wrapper_8c.html#a806fa9a72091f47fa04844f988166e70">SetConfigDone()</a>, and <a class="el" href="struct_usb___dev_data.html#ab54eee2cc1c6a5d178c976f187a2ea47">Usb_DevData::Speed</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
